Require("CommonScript/Kin/KinDef.lua")
DomainBattle.define = {
  szOpenTimeFrame = "OpenDomainBattle",
  nMinLevel = 20,
  nNewsTimeLast = 172800,
  tbNotifyBeginSet = {900, 300},
  nKillPlayerAddScore = 50,
  nKillFlagAddScore = 200,
  tbNpcId_Door = {
    [1] = 1723,
    [2] = 1777
  },
  tbDoorBuff = {1717, 1},
  tbFlagBuff = {1065, 5},
  tbAttackDoorBuff = {2, 1},
  nDynamicObstacleNpcId = 104,
  szDynamicObstacleCamp = "wall",
  szTrapGotoAttack = "TrapToAttack",
  nCallNpcMinDistance = 40,
  tbCanDeclareCareer = {
    [Kin.Def.Career_Master] = 1,
    [Kin.Def.Career_ViceMaster] = 1
  },
  tbCanUseItemCareer = {
    [Kin.Def.Career_Master] = 1,
    [Kin.Def.Career_ViceMaster] = 1,
    [Kin.Def.Career_Elder] = 1
  },
  tbBattleApplyIds = {
    [2502] = {
      "UseItemCallDialogNpc",
      1733,
      16,
      true,
      "攻城车"
    },
    [2503] = {
      "UseItemCallDialogNpc",
      1734,
      16,
      false,
      "劲弩车"
    },
    [2504] = {
      "UseItemCallDialogNpc",
      1735,
      16,
      false,
      "铁炮车"
    },
    [2505] = {
      "UseItemCallAttackNpc",
      1730,
      16,
      "神射手",
      150
    },
    [2506] = {
      "UseItemCallAttackNpc",
      1731,
      40,
      "鼓舞旗",
      200
    }
  },
  tbBattleApplyLimit = {
    [2502] = 4,
    [2503] = 5,
    [2504] = 3,
    [2505] = 10,
    [2506] = 2
  },
  tbBattleApplyIdOrder = {
    2505,
    2506,
    2502,
    2503,
    2504
  },
  tbTimeFrameLevel = {
    {
      "OpenLevel59",
      55
    },
    {
      "OpenLevel69",
      65
    },
    {
      "OpenLevel79",
      75
    },
    {
      "OpenLevel89",
      85
    },
    {
      "OpenLevel99",
      95
    },
    {
      "OpenLevel109",
      105
    },
    {
      "OpenLevel119",
      115
    },
    {
      "OpenLevel129",
      125
    }
  },
  tbFlagHpStateNotify = {
    {
      0.4,
      "即将倒塌"
    },
    {
      0.7,
      "损毁严重"
    },
    {
      0.99,
      "正在被攻击"
    }
  },
  tbBaseAcutionAward = {
    {
      2168,
      1,
      true
    }
  },
  szMapMasterIndex = "LT_chengzhu",
  tbExchangeBoxHonor = {
    {
      "OpenLevel59",
      4687,
      800
    },
    {
      "OpenLevel69",
      4687,
      800
    },
    {
      "OpenLevel79",
      4687,
      800
    },
    {
      "OpenLevel89",
      4687,
      800
    },
    {
      "OpenLevel99",
      4687,
      800
    },
    {
      "OpenLevel109",
      4687,
      800
    }
  },
  tbFlagScore = {
    [1] = {
      [3] = {16000000, 50},
      [2] = {8000000, 25}
    },
    [2] = {
      [3] = {8000000, 30},
      [2] = {400000000, 15}
    },
    [3] = {
      [3] = {8000000, 40}
    }
  },
  tbFlagAwardSetting = {
    {
      "OpenLevel59",
      {
        {
          2400,
          0.75,
          6000000
        },
        {
          1394,
          0.25,
          500000
        }
      }
    },
    {
      "OpenLevel69",
      {
        {
          2400,
          0.375,
          6000000
        },
        {
          2696,
          0.125,
          135000000
        },
        {
          4302,
          0.1875,
          10000000
        },
        {
          1394,
          0.125,
          500000
        },
        {
          1395,
          0.1875,
          100000000
        }
      }
    },
    {
      "OpenLevel79",
      {
        {
          2400,
          0.25,
          6000000
        },
        {
          2696,
          0.0625,
          135000000
        },
        {
          4302,
          0.1875,
          10000000
        },
        {
          4303,
          0,
          20000000
        },
        {
          1395,
          0.5,
          100000000
        }
      }
    },
    {
      "OpenDay99",
      {
        {
          2400,
          0.25,
          6000000
        },
        {
          2696,
          0.0625,
          135000000
        },
        {
          4302,
          0.0625,
          10000000
        },
        {
          4303,
          0.125,
          20000000
        },
        {
          1395,
          0.5,
          100000000
        }
      }
    },
    {
      "OpenLevel89",
      {
        nMapLevel1 = {
          {
            2400,
            0.25,
            6000000
          },
          {
            2696,
            0.08333333333333333,
            135000000
          },
          {
            4302,
            0.0625,
            10000000
          },
          {
            4303,
            0.125,
            20000000
          },
          {
            1396,
            0.16666666666666666,
            30000000
          },
          {
            1395,
            0.3125,
            100000000
          }
        },
        nMapLevel2 = {
          {
            2400,
            0.25,
            6000000
          },
          {
            2696,
            0.08333333333333333,
            135000000
          },
          {
            4302,
            0.0625,
            10000000
          },
          {
            4303,
            0.125,
            20000000
          },
          {
            1396,
            0.16666666666666666,
            30000000
          },
          {
            1395,
            0.3125,
            100000000
          }
        },
        nMapLevel3 = {
          {
            2400,
            0.25,
            6000000
          },
          {
            2696,
            0.0625,
            135000000
          },
          {
            4302,
            0.0625,
            10000000
          },
          {
            4303,
            0.125,
            20000000
          },
          {
            1395,
            0.5,
            100000000
          }
        }
      }
    },
    {
      "OpenLevel99",
      {
        nMapLevel1 = {
          {
            2400,
            0.25,
            6000000
          },
          {
            2696,
            0.0625,
            135000000
          },
          {
            4303,
            0.1875,
            20000000
          },
          {
            4304,
            0,
            40000000
          },
          {
            1396,
            0.25,
            30000000
          },
          {
            1395,
            0.25,
            100000000
          }
        },
        nMapLevel2 = {
          {
            2400,
            0.25,
            6000000
          },
          {
            2696,
            0.0625,
            135000000
          },
          {
            4303,
            0.1875,
            20000000
          },
          {
            4304,
            0,
            40000000
          },
          {
            1396,
            0.25,
            30000000
          },
          {
            1395,
            0.25,
            100000000
          }
        },
        nMapLevel3 = {
          {
            2400,
            0.25,
            6000000
          },
          {
            2696,
            0.0625,
            135000000
          },
          {
            4303,
            0.1875,
            20000000
          },
          {
            4304,
            0,
            40000000
          },
          {
            1395,
            0.5,
            100000000
          }
        }
      }
    },
    {
      "OpenDay224",
      {
        nMapLevel1 = {
          {
            2400,
            0.25,
            6000000
          },
          {
            2696,
            0.0625,
            135000000
          },
          {
            4303,
            0.0625,
            20000000
          },
          {
            4304,
            0.125,
            40000000
          },
          {
            1396,
            0.25,
            30000000
          },
          {
            1395,
            0.25,
            100000000
          }
        },
        nMapLevel2 = {
          {
            2400,
            0.25,
            6000000
          },
          {
            2696,
            0.0625,
            135000000
          },
          {
            4303,
            0.0625,
            20000000
          },
          {
            4304,
            0.125,
            40000000
          },
          {
            1396,
            0.25,
            30000000
          },
          {
            1395,
            0.25,
            100000000
          }
        },
        nMapLevel3 = {
          {
            2400,
            0.25,
            6000000
          },
          {
            2696,
            0.0625,
            135000000
          },
          {
            4303,
            0.0625,
            20000000
          },
          {
            4304,
            0.125,
            40000000
          },
          {
            1395,
            0.5,
            100000000
          }
        }
      }
    },
    {
      "OpenLevel109",
      {
        nMapLevel1 = {
          {
            2400,
            0.25,
            6000000
          },
          {
            2696,
            0.0625,
            135000000
          },
          {
            4303,
            0.0625,
            20000000
          },
          {
            4304,
            0.125,
            40000000
          },
          {
            1396,
            0.3333333333333333,
            30000000
          },
          {
            1395,
            0.16666666666666666,
            100000000
          }
        },
        nMapLevel2 = {
          {
            2400,
            0.25,
            6000000
          },
          {
            2696,
            0.0625,
            135000000
          },
          {
            4303,
            0.0625,
            20000000
          },
          {
            4304,
            0.125,
            40000000
          },
          {
            1396,
            0.3333333333333333,
            30000000
          },
          {
            1395,
            0.16666666666666666,
            100000000
          }
        },
        nMapLevel3 = {
          {
            2400,
            0.25,
            6000000
          },
          {
            2696,
            0.0625,
            135000000
          },
          {
            4303,
            0.0625,
            20000000
          },
          {
            4304,
            0.125,
            40000000
          },
          {
            1396,
            0.125,
            30000000
          },
          {
            1395,
            0.375,
            100000000
          }
        }
      }
    },
    {
      "OpenDay279",
      {
        nMapLevel1 = {
          {
            2400,
            0.1,
            6000000
          },
          {
            4053,
            0.1,
            400000000
          },
          {
            4303,
            0.05,
            40000000
          },
          {
            4304,
            0.125,
            800000
          },
          {
            1395,
            0.05,
            30000000
          },
          {
            1396,
            0.325,
            100000000
          },
          {
            4056,
            0.175,
            18000000
          },
          {
            4057,
            0.075,
            1000000000
          }
        },
        nMapLevel2 = {
          {
            2400,
            0.1,
            6000000
          },
          {
            4053,
            0.1,
            400000000
          },
          {
            4303,
            0.05,
            40000000
          },
          {
            4304,
            0.125,
            800000
          },
          {
            1395,
            0.05,
            30000000
          },
          {
            1396,
            0.325,
            100000000
          },
          {
            4056,
            0.175,
            18000000
          },
          {
            4057,
            0.075,
            1000000000
          }
        },
        nMapLevel3 = {
          {
            2400,
            0.25,
            6000000
          },
          {
            2696,
            0.05,
            135000000
          },
          {
            4053,
            0.0625,
            400000000
          },
          {
            4303,
            0.0625,
            40000000
          },
          {
            4304,
            0.125,
            800000
          },
          {
            1395,
            0.25,
            30000000
          },
          {
            1396,
            0.125,
            100000000
          },
          {
            4056,
            0.075,
            18000000
          }
        }
      }
    },
    {
      "OpenLevel119",
      {
        nMapLevel1 = {
          {
            2400,
            0.075,
            6000000
          },
          {
            4053,
            0.1,
            400000000
          },
          {
            4303,
            0.05,
            40000000
          },
          {
            4304,
            0.125,
            800000
          },
          {
            1395,
            0.05,
            30000000
          },
          {
            1396,
            0.325,
            100000000
          },
          {
            4056,
            0.2,
            18000000
          },
          {
            4057,
            0.075,
            1000000000
          }
        },
        nMapLevel2 = {
          {
            2400,
            0.075,
            6000000
          },
          {
            4053,
            0.1,
            400000000
          },
          {
            4303,
            0.05,
            40000000
          },
          {
            4304,
            0.125,
            800000
          },
          {
            1395,
            0.05,
            30000000
          },
          {
            1396,
            0.325,
            100000000
          },
          {
            4056,
            0.2,
            18000000
          },
          {
            4057,
            0.075,
            1000000000
          }
        },
        nMapLevel3 = {
          {
            2400,
            0.2,
            6000000
          },
          {
            2696,
            0.05,
            135000000
          },
          {
            4053,
            0.0875,
            400000000
          },
          {
            4303,
            0.05,
            40000000
          },
          {
            4304,
            0.1375,
            800000
          },
          {
            1395,
            0.25,
            30000000
          },
          {
            1396,
            0.125,
            100000000
          },
          {
            4056,
            0.1,
            18000000
          }
        }
      }
    },
    {
      "OpenDay399",
      {
        nMapLevel1 = {
          {
            2400,
            0.075,
            6000000
          },
          {
            4053,
            0.1,
            400000000
          },
          {
            4304,
            0.05,
            40000000
          },
          {
            4305,
            0.125,
            800000
          },
          {
            1395,
            0.05,
            30000000
          },
          {
            1396,
            0.325,
            100000000
          },
          {
            4056,
            0.2,
            18000000
          },
          {
            4057,
            0.075,
            1000000000
          }
        },
        nMapLevel2 = {
          {
            2400,
            0.075,
            6000000
          },
          {
            4053,
            0.1,
            400000000
          },
          {
            4304,
            0.05,
            40000000
          },
          {
            4305,
            0.125,
            800000
          },
          {
            1395,
            0.05,
            30000000
          },
          {
            1396,
            0.325,
            100000000
          },
          {
            4056,
            0.2,
            18000000
          },
          {
            4057,
            0.075,
            1000000000
          }
        },
        nMapLevel3 = {
          {
            2400,
            0.2,
            6000000
          },
          {
            2696,
            0.05,
            135000000
          },
          {
            4053,
            0.0875,
            400000000
          },
          {
            4304,
            0.0625,
            40000000
          },
          {
            4305,
            0.125,
            800000
          },
          {
            1395,
            0.25,
            30000000
          },
          {
            1396,
            0.125,
            100000000
          },
          {
            4056,
            0.1,
            18000000
          }
        }
      }
    },
    {
      "OpenLevel129",
      {
        nMapLevel1 = {
          {
            2400,
            0.075,
            6000000
          },
          {
            4053,
            0.075,
            400000000
          },
          {
            4304,
            0.05,
            40000000
          },
          {
            4305,
            0.125,
            800000
          },
          {
            1395,
            0.05,
            30000000
          },
          {
            1396,
            0.325,
            100000000
          },
          {
            4056,
            0.2,
            18000000
          },
          {
            4057,
            0.1,
            1000000000
          }
        },
        nMapLevel2 = {
          {
            2400,
            0.075,
            6000000
          },
          {
            4053,
            0.075,
            400000000
          },
          {
            4304,
            0.05,
            40000000
          },
          {
            4305,
            0.125,
            800000
          },
          {
            1395,
            0.05,
            30000000
          },
          {
            1396,
            0.325,
            100000000
          },
          {
            4056,
            0.2,
            18000000
          },
          {
            4057,
            0.1,
            1000000000
          }
        },
        nMapLevel3 = {
          {
            2400,
            0.2,
            6000000
          },
          {
            2696,
            0.05,
            135000000
          },
          {
            4053,
            0.0875,
            400000000
          },
          {
            4304,
            0.05,
            40000000
          },
          {
            4305,
            0.125,
            800000
          },
          {
            1395,
            0.2,
            30000000
          },
          {
            1396,
            0.1875,
            100000000
          },
          {
            4056,
            0.1,
            18000000
          }
        }
      }
    }
  },
  tbMemberAwardSetting = {
    {
      nPos = 1,
      Award = {
        {
          "DomainHonor",
          3200
        },
        {"BasicExp", 180}
      }
    },
    {
      nPos = 2,
      Award = {
        {
          "DomainHonor",
          3000
        },
        {"BasicExp", 170}
      }
    },
    {
      nPos = 3,
      Award = {
        {
          "DomainHonor",
          2800
        },
        {"BasicExp", 160}
      }
    },
    {
      fPos = 0.1,
      Award = {
        {
          "DomainHonor",
          2600
        },
        {"BasicExp", 150}
      }
    },
    {
      fPos = 0.2,
      Award = {
        {
          "DomainHonor",
          2400
        },
        {"BasicExp", 140}
      }
    },
    {
      fPos = 0.3,
      Award = {
        {
          "DomainHonor",
          2200
        },
        {"BasicExp", 130}
      }
    },
    {
      fPos = 0.5,
      Award = {
        {
          "DomainHonor",
          2000
        },
        {"BasicExp", 120}
      }
    },
    {
      fPos = 0.7,
      Award = {
        {
          "DomainHonor",
          1800
        },
        {"BasicExp", 110}
      }
    },
    {
      fPos = 0.9,
      Award = {
        {
          "DomainHonor",
          1600
        },
        {"BasicExp", 105}
      }
    },
    {
      fPos = 1,
      Award = {
        {
          "DomainHonor",
          1400
        },
        {"BasicExp", 100}
      }
    }
  },
  tbCityMasterAward = {
    {
      "OpenLevel39",
      {
        {
          "AddTimeTitle",
          6000
        },
        {
          "item",
          2507,
          1
        }
      }
    },
    {
      "OpenLevel79",
      {
        {
          "AddTimeTitle",
          6000
        },
        {
          "item",
          2508,
          1
        }
      }
    },
    {
      "OpenLevel99",
      {
        {
          "AddTimeTitle",
          6000
        },
        {
          "item",
          3639,
          1
        }
      }
    },
    {
      "OpenLevel119",
      {
        {
          "AddTimeTitle",
          6000
        },
        {
          "item",
          4583,
          1
        }
      }
    }
  },
  tbMasterStatuePos = {
    10,
    11636,
    9113,
    0
  },
  tbMasterStatueId = {
    [1] = 1841,
    [2] = 1842,
    [3] = 1843,
    [4] = 1844,
    [5] = 1845,
    [6] = 1846,
    [7] = 1847,
    [8] = 1848,
    [9] = 2000,
    [10] = 2002,
    [11] = 2215,
    [12] = 2216,
    [13] = 2379,
    [14] = 2380
  },
  tbKinPrestigeSetting = {
    [1] = {nOwner = 1000, nHasFlag = 400},
    [2] = {nOwner = 500, nHasFlag = 200},
    [3] = {nOwner = 200, nHasFlag = 0}
  },
  nKinDecarlePrestige = 50,
  FireNpcTemplateId = 1817,
  nFireNpcTime = 180,
  tbActOwnerScoreSetting = {
    [1] = {800000000, 80},
    [2] = {40000000000, 60},
    [3] = {20000000000, 40}
  },
  tbActOwnerItemSetting = {
    {
      "OpenLevel59",
      {
        {
          2168,
          0.6666666666666666,
          45000000,
          true
        },
        {
          1394,
          0.3333333333333333,
          50000000,
          false
        }
      }
    },
    {
      "OpenLevel69",
      {
        {
          2168,
          0.375,
          45000000,
          true
        },
        {
          2169,
          0.25,
          135000000,
          true
        },
        {
          4312,
          0.125,
          10000000,
          false
        },
        {
          1395,
          0.1875,
          100000000,
          false
        },
        {
          2271,
          0.0625,
          30000000,
          true
        }
      }
    },
    {
      "OpenLevel79",
      {
        {
          2168,
          0.3125,
          45000000,
          true
        },
        {
          2169,
          0.3125,
          135000000,
          true
        },
        {
          4312,
          0.125,
          10000000,
          false
        },
        {
          4313,
          0,
          20000000,
          false
        },
        {
          1395,
          0.1875,
          100000000,
          false
        },
        {
          2271,
          0.0625,
          30000000,
          true
        }
      }
    },
    {
      "OpenDay99",
      {
        {
          2168,
          0.3125,
          45000000,
          true
        },
        {
          2169,
          0.3125,
          135000000,
          true
        },
        {
          4312,
          0.04125,
          10000000,
          false
        },
        {
          4313,
          0.08375,
          20000000,
          false
        },
        {
          1395,
          0.1875,
          100000000,
          false
        },
        {
          2271,
          0.0625,
          30000000,
          true
        }
      }
    },
    {
      "OpenLevel89",
      {
        {
          2168,
          0.1875,
          45000000,
          true
        },
        {
          2169,
          0.4375,
          135000000,
          true
        },
        {
          4312,
          0.04125,
          10000000,
          false
        },
        {
          4313,
          0.08375,
          20000000,
          false
        },
        {
          1395,
          0.1875,
          100000000,
          false
        },
        {
          2271,
          0.0625,
          30000000,
          true
        }
      }
    },
    {
      "OpenLevel99",
      {
        {
          2168,
          0.125,
          45000000,
          true
        },
        {
          2169,
          0.5,
          135000000,
          true
        },
        {
          4312,
          0.03125,
          20000000,
          false
        },
        {
          4313,
          0.09375,
          40000000,
          false
        },
        {
          1395,
          0.125,
          100000000,
          false
        },
        {
          1396,
          0.0625,
          100000000,
          false
        },
        {
          2271,
          0.0625,
          30000000,
          true
        }
      }
    },
    {
      "OpenDay224",
      {
        {
          2168,
          0.125,
          45000000,
          true
        },
        {
          2169,
          0.5,
          135000000,
          true
        },
        {
          4313,
          0.04125,
          20000000,
          false
        },
        {
          4314,
          0.08375,
          40000000,
          false
        },
        {
          1395,
          0.125,
          100000000,
          false
        },
        {
          1396,
          0.0625,
          100000000,
          false
        },
        {
          2271,
          0.0625,
          30000000,
          true
        }
      }
    },
    {
      "OpenLevel109",
      {
        {
          2168,
          0.125,
          45000000,
          true
        },
        {
          2169,
          0.5,
          135000000,
          true
        },
        {
          4313,
          0.04125,
          20000000,
          false
        },
        {
          4314,
          0.08375,
          40000000,
          false
        },
        {
          1395,
          0.125,
          100000000,
          false
        },
        {
          1396,
          0.0625,
          100000000,
          false
        },
        {
          2271,
          0.0625,
          30000000,
          true
        }
      }
    },
    {
      "OpenLevel119",
      {
        {
          2168,
          0.125,
          45000000,
          true
        },
        {
          2169,
          0.5,
          135000000,
          true
        },
        {
          4313,
          0.03125,
          40000000,
          false
        },
        {
          4314,
          0.09375,
          800000,
          false
        },
        {
          1395,
          0.0625,
          100000000,
          false
        },
        {
          1396,
          0.125,
          100000000,
          false
        },
        {
          2271,
          0.0625,
          30000000,
          true
        }
      }
    },
    {
      "OpenDay399",
      {
        {
          2168,
          0.125,
          45000000,
          true
        },
        {
          2169,
          0.5,
          135000000,
          true
        },
        {
          4314,
          0.04125,
          40000000,
          false
        },
        {
          4315,
          0.08375,
          800000,
          false
        },
        {
          1395,
          0.0625,
          100000000,
          false
        },
        {
          1396,
          0.125,
          100000000,
          false
        },
        {
          2271,
          0.0625,
          30000000,
          true
        }
      }
    },
    {
      "OpenLevel129",
      {
        {
          2168,
          0.0625,
          45000000,
          true
        },
        {
          2169,
          0.5625,
          135000000,
          true
        },
        {
          4314,
          0.04125,
          40000000,
          false
        },
        {
          4315,
          0.08375,
          800000,
          false
        },
        {
          1395,
          0.05,
          100000000,
          false
        },
        {
          1396,
          0.1375,
          100000000,
          false
        },
        {
          2271,
          0.0625,
          30000000,
          true
        }
      }
    }
  }
}
local tbMapSetting = {
  nMapTemplateId = 1400,
  tbChilds = {
    {
      nMapTemplateId = 1401,
      tbChilds = {
        {nMapTemplateId = 1405},
        {nMapTemplateId = 1406}
      }
    },
    {
      nMapTemplateId = 1402,
      tbChilds = {
        {nMapTemplateId = 1407},
        {nMapTemplateId = 1408}
      }
    },
    {
      nMapTemplateId = 1403,
      tbChilds = {
        {nMapTemplateId = 1409},
        {nMapTemplateId = 1410}
      }
    },
    {
      nMapTemplateId = 1404,
      tbChilds = {
        {nMapTemplateId = 1411},
        {nMapTemplateId = 1412}
      }
    }
  }
}
local tbMapPosSetting = {
  [1400] = {
    tbAtackPos = {
      {
        5405,
        12040,
        "TrapToDXC",
        "稻香村",
        "TrapToFight4",
        {
          {6798, 12236},
          {6782, 11918},
          {6793, 11589},
          {6793, 11239}
        },
        "TrapToPeace4",
        {
          {6329, 12206},
          {6326, 11894},
          {6316, 11600},
          {6292, 11287}
        }
      },
      {
        5246,
        9386,
        "TrapToBLX",
        "巴陵县",
        "TrapToFight3",
        {
          {6520, 9536},
          {6522, 9215},
          {6517, 8892},
          {6522, 8585}
        },
        "TrapToPeace3",
        {
          {6064, 9573},
          {6059, 9273},
          {6059, 8966},
          {6024, 8627}
        }
      },
      {
        5184,
        6856,
        "TrapToJJC",
        "江津村",
        "TrapToFight2",
        {
          {6430, 7379},
          {6427, 7045},
          {6435, 6701},
          {6443, 6319}
        },
        "TrapToPeace2",
        {
          {5939, 7302},
          {5955, 7008},
          {5947, 6704},
          {5953, 6367}
        }
      },
      {
        5449,
        4149,
        "TrapToYLZ",
        "永乐镇",
        "TrapToFight1",
        {
          {6727, 4779},
          {6802, 4157},
          {6770, 4468},
          {6858, 3771}
        },
        "TrapToPeace1",
        {
          {6253, 4562},
          {6274, 4310},
          {6298, 4029},
          {6349, 3739}
        }
      }
    },
    tbDefendPos = {20874, 8188},
    tbCampDynamicObstacle = {
      {
        6568,
        11660,
        32
      },
      {
        6568,
        12052,
        32
      },
      {
        6568,
        11296,
        32
      },
      {
        6286,
        8971,
        32
      },
      {
        6286,
        9338,
        32
      },
      {
        6286,
        8580,
        32
      },
      {
        6172,
        6821,
        32
      },
      {
        6172,
        7200,
        32
      },
      {
        6172,
        6420,
        32
      },
      {
        6533,
        4186,
        30
      },
      {
        6481,
        4557,
        30
      },
      {
        6593,
        3790,
        30
      }
    },
    tbStartPutNpcs = {
      {
        73,
        19677,
        8303,
        0
      },
      {
        73,
        6440,
        11730,
        0
      },
      {
        73,
        6170,
        9124,
        0
      },
      {
        73,
        6057,
        6864,
        0
      },
      {
        73,
        6415,
        4142,
        0
      }
    },
    TrapOutN = {
      {12749, 11220},
      {12753, 11054},
      {12760, 10837}
    },
    TrapOutM = {
      {12758, 8498},
      {12754, 8262},
      {12760, 8029}
    },
    TrapOutS = {
      {12778, 5757},
      {12770, 5594},
      {12778, 5430}
    },
    tbPosBackCampOut = {
      {19053, 8651},
      {19057, 8489},
      {19053, 8292},
      {19041, 8112},
      {19046, 7932}
    },
    tbPosBackCampIn = {
      {19899, 8253}
    },
    Doors = {
      {
        12857,
        11027,
        48,
        "gate_n",
        "DES_GateN",
        "TrapOutN",
        "北城门"
      },
      {
        12854,
        8273,
        48,
        "gate_m",
        "DES_GateM",
        "TrapOutM",
        "中城门"
      },
      {
        12856,
        5611,
        48,
        "gate_s",
        "DES_GateS",
        "TrapOutS",
        "南城门"
      }
    },
    tbFlogNpcPos = {
      {
        1724,
        3,
        15536,
        8278,
        48,
        "OCC_Longzhu_sun"
      },
      {
        1725,
        2,
        15536,
        11012,
        48,
        "OCC_Longzhu_moon"
      },
      {
        1726,
        2,
        15539,
        5577,
        48,
        "OCC_Longzhu_star"
      }
    }
  },
  [1401] = {
    tbAtackPos = {
      {
        4719,
        10048,
        "TrapToFlield_dthp",
        "洞庭湖畔",
        "TrapToFight2",
        {
          {5369, 9316},
          {5621, 9577},
          {5897, 9825},
          {6130, 10064}
        },
        "TrapToPeace2",
        {
          {4941, 9649},
          {5124, 9869},
          {5570, 10227},
          {5755, 10430}
        }
      },
      {
        4328,
        3979,
        "TrapToFlield_ml",
        "苗岭",
        "TrapToFight1",
        {
          {5449, 5189},
          {5615, 4709},
          {5876, 4262},
          {6082, 3974}
        },
        "TrapToPeace1",
        {
          {4923, 4973},
          {4995, 4663},
          {5269, 4004},
          {5511, 3670}
        }
      }
    },
    tbDefendPos = {19490, 7343},
    tbCampDynamicObstacle = {
      {
        5869,
        10179,
        40
      },
      {
        5241,
        9549,
        40
      },
      {
        5554,
        9857,
        40
      },
      {
        5449,
        4405,
        27
      },
      {
        5668,
        4014,
        27
      },
      {
        5228,
        4877,
        27
      }
    },
    tbStartPutNpcs = {
      {
        73,
        18634,
        7286,
        0
      },
      {
        73,
        5407,
        9988,
        0
      },
      {
        73,
        5226,
        4417,
        0
      }
    },
    TrapOutN = {
      {11553, 9691},
      {11467, 9595},
      {11382, 9469},
      {11242, 9318}
    },
    TrapOutS = {
      {11434, 4875},
      {11589, 4749},
      {11306, 5012},
      {11712, 4614}
    },
    tbPosBackCampOut = {
      {18046, 7611},
      {18038, 7422},
      {18038, 7266},
      {18043, 7128},
      {18051, 6953}
    },
    tbPosBackCampIn = {
      {18828, 7266}
    },
    Doors = {
      {
        11593,
        9426,
        23,
        "gate_n",
        "DES_GateN",
        "TrapOutN",
        "北城门"
      },
      {
        11622,
        5054,
        39,
        "gate_s",
        "DES_GateS",
        "TrapOutS",
        "南城门"
      }
    },
    tbFlogNpcPos = {
      {
        1724,
        3,
        13159,
        7279,
        40,
        "OCC_Longzhu_sun"
      },
      {
        1725,
        2,
        14861,
        10191,
        40,
        "OCC_Longzhu_moon"
      },
      {
        1726,
        2,
        14863,
        4967,
        40,
        "OCC_Longzhu_star"
      }
    }
  },
  [1402] = {
    tbAtackPos = {
      {
        4719,
        10048,
        "TrapToFlield_xsd",
        "点苍山",
        "TrapToFight2",
        {
          {5369, 9316},
          {5621, 9577},
          {5897, 9825},
          {6130, 10064}
        },
        "TrapToPeace2",
        {
          {4941, 9649},
          {5124, 9869},
          {5570, 10227},
          {5755, 10430}
        }
      },
      {
        4328,
        3979,
        "TrapToFlield_dcs",
        "响水洞",
        "TrapToFight1",
        {
          {5449, 5189},
          {5615, 4709},
          {5876, 4262},
          {6082, 3974}
        },
        "TrapToPeace1",
        {
          {4923, 4973},
          {4995, 4663},
          {5269, 4004},
          {5511, 3670}
        }
      }
    },
    tbDefendPos = {19490, 7343},
    tbCampDynamicObstacle = {
      {
        5869,
        10179,
        40
      },
      {
        5241,
        9549,
        40
      },
      {
        5554,
        9857,
        40
      },
      {
        5449,
        4405,
        27
      },
      {
        5668,
        4014,
        27
      },
      {
        5228,
        4877,
        27
      }
    },
    tbStartPutNpcs = {
      {
        73,
        18634,
        7286,
        0
      },
      {
        73,
        5407,
        9988,
        0
      },
      {
        73,
        5226,
        4417,
        0
      }
    },
    TrapOutN = {
      {11553, 9691},
      {11467, 9595},
      {11382, 9469},
      {11242, 9318}
    },
    TrapOutS = {
      {11434, 4875},
      {11589, 4749},
      {11306, 5012},
      {11712, 4614}
    },
    tbPosBackCampOut = {
      {18046, 7611},
      {18038, 7422},
      {18038, 7266},
      {18043, 7128},
      {18051, 6953}
    },
    tbPosBackCampIn = {
      {18828, 7266}
    },
    Doors = {
      {
        11593,
        9426,
        23,
        "gate_n",
        "DES_GateN",
        "TrapOutN",
        "北城门"
      },
      {
        11622,
        5054,
        39,
        "gate_s",
        "DES_GateS",
        "TrapOutS",
        "南城门"
      }
    },
    tbFlogNpcPos = {
      {
        1724,
        3,
        13159,
        7279,
        40,
        "OCC_Longzhu_sun"
      },
      {
        1725,
        2,
        14861,
        10191,
        40,
        "OCC_Longzhu_moon"
      },
      {
        1726,
        2,
        14863,
        4967,
        40,
        "OCC_Longzhu_star"
      }
    }
  },
  [1403] = {
    tbAtackPos = {
      {
        4328,
        3979,
        "TrapToFlield_jxf",
        "见性峰",
        "TrapToFight1",
        {
          {5449, 5189},
          {5615, 4709},
          {5876, 4262},
          {6082, 3974}
        },
        "TrapToPeace1",
        {
          {4923, 4973},
          {4995, 4663},
          {5269, 4004},
          {5511, 3670}
        }
      },
      {
        4719,
        10048,
        "TrapToFlield_jmg",
        "剑门关",
        "TrapToFight2",
        {
          {5369, 9316},
          {5621, 9577},
          {5897, 9825},
          {6130, 10064}
        },
        "TrapToPeace2",
        {
          {4941, 9649},
          {5124, 9869},
          {5570, 10227},
          {5755, 10430}
        }
      }
    },
    tbDefendPos = {19490, 7343},
    tbCampDynamicObstacle = {
      {
        5869,
        10179,
        40
      },
      {
        5241,
        9549,
        40
      },
      {
        5554,
        9857,
        40
      },
      {
        5449,
        4405,
        27
      },
      {
        5668,
        4014,
        27
      },
      {
        5228,
        4877,
        27
      }
    },
    tbStartPutNpcs = {
      {
        73,
        18634,
        7286,
        0
      },
      {
        73,
        5407,
        9988,
        0
      },
      {
        73,
        5226,
        4417,
        0
      }
    },
    TrapOutN = {
      {11553, 9691},
      {11467, 9595},
      {11382, 9469},
      {11242, 9318}
    },
    TrapOutS = {
      {11434, 4875},
      {11589, 4749},
      {11306, 5012},
      {11712, 4614}
    },
    tbPosBackCampOut = {
      {18046, 7611},
      {18038, 7422},
      {18038, 7266},
      {18043, 7128},
      {18051, 6953}
    },
    tbPosBackCampIn = {
      {18828, 7266}
    },
    Doors = {
      {
        11593,
        9426,
        23,
        "gate_n",
        "DES_GateN",
        "TrapOutN",
        "北城门"
      },
      {
        11622,
        5054,
        39,
        "gate_s",
        "DES_GateS",
        "TrapOutS",
        "南城门"
      }
    },
    tbFlogNpcPos = {
      {
        1724,
        3,
        13159,
        7279,
        40,
        "OCC_Longzhu_sun"
      },
      {
        1725,
        2,
        14861,
        10191,
        40,
        "OCC_Longzhu_moon"
      },
      {
        1726,
        2,
        14863,
        4967,
        40,
        "OCC_Longzhu_star"
      }
    }
  },
  [1404] = {
    tbAtackPos = {
      {
        4328,
        3979,
        "TrapToFlield_jjd",
        "荐菊洞",
        "TrapToFight1",
        {
          {5449, 5189},
          {5615, 4709},
          {5876, 4262},
          {6082, 3974}
        },
        "TrapToPeace1",
        {
          {4923, 4973},
          {4995, 4663},
          {5269, 4004},
          {5511, 3670}
        }
      },
      {
        4719,
        10048,
        "TrapToFlield_fns",
        "伏牛山",
        "TrapToFight2",
        {
          {5369, 9316},
          {5621, 9577},
          {5897, 9825},
          {6130, 10064}
        },
        "TrapToPeace2",
        {
          {4941, 9649},
          {5124, 9869},
          {5570, 10227},
          {5755, 10430}
        }
      }
    },
    tbDefendPos = {19490, 7343},
    tbCampDynamicObstacle = {
      {
        5869,
        10179,
        40
      },
      {
        5241,
        9549,
        40
      },
      {
        5554,
        9857,
        40
      },
      {
        5449,
        4405,
        27
      },
      {
        5668,
        4014,
        27
      },
      {
        5228,
        4877,
        27
      }
    },
    tbStartPutNpcs = {
      {
        73,
        18634,
        7286,
        0
      },
      {
        73,
        5407,
        9988,
        0
      },
      {
        73,
        5226,
        4417,
        0
      }
    },
    TrapOutN = {
      {11553, 9691},
      {11467, 9595},
      {11382, 9469},
      {11242, 9318}
    },
    TrapOutS = {
      {11434, 4875},
      {11589, 4749},
      {11306, 5012},
      {11712, 4614}
    },
    tbPosBackCampOut = {
      {18046, 7611},
      {18038, 7422},
      {18038, 7266},
      {18043, 7128},
      {18051, 6953}
    },
    tbPosBackCampIn = {
      {18828, 7266}
    },
    Doors = {
      {
        11593,
        9426,
        23,
        "gate_n",
        "DES_GateN",
        "TrapOutN",
        "北城门"
      },
      {
        11622,
        5054,
        39,
        "gate_s",
        "DES_GateS",
        "TrapOutS",
        "南城门"
      }
    },
    tbFlogNpcPos = {
      {
        1724,
        3,
        13159,
        7279,
        40,
        "OCC_Longzhu_sun"
      },
      {
        1725,
        2,
        14861,
        10191,
        40,
        "OCC_Longzhu_moon"
      },
      {
        1726,
        2,
        14863,
        4967,
        40,
        "OCC_Longzhu_star"
      }
    }
  },
  [1405] = {
    tbAtackPos = {
      {
        13493,
        12656,
        "",
        "天"
      },
      {
        6546,
        11717,
        "",
        "地"
      },
      {
        5106,
        8756,
        "",
        "人"
      }
    },
    tbDefendPos = {13680, 8144},
    tbPosBackCampOut = {
      {12915, 7545}
    },
    tbPosBackCampIn = {
      {13680, 8144}
    },
    tbCampDynamicObstacle = {
      {
        13159,
        12044,
        50
      },
      {
        13387,
        11991,
        50
      },
      {
        7009,
        11322,
        40
      },
      {
        6810,
        11149,
        40
      },
      {
        5675,
        8784,
        32
      },
      {
        5670,
        8552,
        32
      }
    },
    tbStartPutNpcs = {
      {
        73,
        13247,
        7842,
        0
      }
    },
    tbFlogNpcPos = {
      {
        1724,
        3,
        10593,
        7625,
        48,
        "OCC_Longzhu_sun"
      }
    }
  },
  [1406] = {
    tbAtackPos = {
      {
        12774,
        11847,
        "",
        "天"
      },
      {
        6516,
        13097,
        "",
        "地"
      },
      {
        12898,
        5967,
        "",
        "人"
      }
    },
    tbDefendPos = {4795, 8097},
    tbPosBackCampOut = {
      {5698, 8051}
    },
    tbPosBackCampIn = {
      {4795, 8097}
    },
    tbCampDynamicObstacle = {
      {
        12234,
        11557,
        56
      },
      {
        12392,
        11373,
        56
      },
      {
        6416,
        12496,
        48
      },
      {
        6665,
        12496,
        48
      },
      {
        12471,
        6277,
        8
      },
      {
        12689,
        6473,
        8
      }
    },
    tbStartPutNpcs = {
      {
        73,
        5239,
        8037,
        0
      }
    },
    tbFlogNpcPos = {
      {
        1724,
        3,
        8848,
        8233,
        48,
        "OCC_Longzhu_sun"
      }
    }
  },
  [1407] = {
    tbAtackPos = {
      {
        4885,
        12190,
        "",
        "天"
      },
      {
        3893,
        3631,
        "",
        "地"
      },
      {
        12439,
        3685,
        "",
        "人"
      }
    },
    tbDefendPos = {10189, 10810},
    tbPosBackCampOut = {
      {10164, 9967}
    },
    tbPosBackCampIn = {
      {10189, 10810}
    },
    tbCampDynamicObstacle = {
      {
        5038,
        11628,
        48
      },
      {
        4764,
        11638,
        48
      },
      {
        4251,
        4096,
        24
      },
      {
        4400,
        3930,
        24
      },
      {
        12141,
        4208,
        8
      },
      {
        11982,
        4056,
        8
      }
    },
    tbStartPutNpcs = {
      {
        73,
        10140,
        10421,
        0
      }
    },
    tbFlogNpcPos = {
      {
        1724,
        3,
        7994,
        8191,
        48,
        "OCC_Longzhu_sun"
      }
    }
  },
  [1408] = {
    tbAtackPos = {
      {
        6662,
        13040,
        "",
        "天"
      },
      {
        2138,
        10041,
        "",
        "地"
      },
      {
        2502,
        4151,
        "",
        "人"
      }
    },
    tbDefendPos = {10233, 5705},
    tbPosBackCampOut = {
      {10258, 6521}
    },
    tbPosBackCampIn = {
      {10233, 5705}
    },
    tbCampDynamicObstacle = {
      {
        6516,
        12503,
        48
      },
      {
        6783,
        12509,
        48
      },
      {
        2562,
        10149,
        32
      },
      {
        2556,
        9886,
        32
      },
      {
        3013,
        4232,
        32
      },
      {
        3005,
        3970,
        32
      }
    },
    tbStartPutNpcs = {
      {
        73,
        10277,
        6100,
        0
      }
    },
    tbFlogNpcPos = {
      {
        1724,
        3,
        6899,
        7289,
        48,
        "OCC_Longzhu_sun"
      }
    }
  },
  [1409] = {
    tbAtackPos = {
      {
        9763,
        10533,
        "",
        "天"
      },
      {
        3043,
        9514,
        "",
        "地"
      },
      {
        11539,
        5150,
        "",
        "人"
      }
    },
    tbDefendPos = {4127, 4166},
    tbPosBackCampOut = {
      {4824, 4824}
    },
    tbPosBackCampIn = {
      {4127, 4166}
    },
    tbCampDynamicObstacle = {
      {
        9622,
        10032,
        48
      },
      {
        9840,
        10042,
        48
      },
      {
        3570,
        9646,
        32
      },
      {
        3570,
        9354,
        32
      },
      {
        11019,
        5303,
        64
      },
      {
        10996,
        5062,
        64
      }
    },
    tbStartPutNpcs = {
      {
        73,
        4425,
        4456,
        0
      }
    },
    tbFlogNpcPos = {
      {
        1724,
        3,
        6552,
        6364,
        48,
        "OCC_Longzhu_sun"
      }
    }
  },
  [1410] = {
    tbAtackPos = {
      {
        11607,
        11286,
        "",
        "天"
      },
      {
        4662,
        11625,
        "",
        "地"
      },
      {
        4633,
        4282,
        "",
        "人"
      }
    },
    tbDefendPos = {11799, 6730},
    tbPosBackCampOut = {
      {10910, 6790}
    },
    tbPosBackCampIn = {
      {11799, 6730}
    },
    tbCampDynamicObstacle = {
      {
        11098,
        11038,
        56
      },
      {
        11257,
        10834,
        56
      },
      {
        4490,
        11127,
        48
      },
      {
        4775,
        11124,
        48
      },
      {
        5112,
        4361,
        32
      },
      {
        5108,
        4108,
        32
      }
    },
    tbStartPutNpcs = {
      {
        73,
        11368,
        6805,
        0
      }
    },
    tbFlogNpcPos = {
      {
        1724,
        3,
        7924,
        7658,
        48,
        "OCC_Longzhu_sun"
      }
    }
  },
  [1411] = {
    tbAtackPos = {
      {
        4013,
        11719,
        "",
        "天"
      },
      {
        4371,
        4020,
        "",
        "地"
      },
      {
        12529,
        4521,
        "",
        "人"
      }
    },
    tbDefendPos = {11325, 10686},
    tbPosBackCampOut = {
      {11227, 9879}
    },
    tbPosBackCampIn = {
      {11325, 10686}
    },
    tbCampDynamicObstacle = {
      {
        4297,
        11213,
        40
      },
      {
        4491,
        11377,
        40
      },
      {
        4678,
        4484,
        24
      },
      {
        4858,
        4288,
        24
      },
      {
        12093,
        4847,
        8
      },
      {
        12307,
        5063,
        8
      }
    },
    tbStartPutNpcs = {
      {
        73,
        11258,
        10321,
        0
      }
    },
    tbFlogNpcPos = {
      {
        1724,
        3,
        8429,
        8322,
        48,
        "OCC_Longzhu_sun"
      }
    }
  },
  [1412] = {
    tbAtackPos = {
      {
        3049,
        8651,
        "",
        "天"
      },
      {
        5108,
        3913,
        "",
        "地"
      },
      {
        12963,
        6173,
        "",
        "人"
      }
    },
    tbDefendPos = {8516, 12643},
    tbPosBackCampOut = {
      {8508, 11837}
    },
    tbPosBackCampIn = {
      {8516, 12643}
    },
    tbCampDynamicObstacle = {
      {
        3484,
        8746,
        32
      },
      {
        3489,
        8480,
        32
      },
      {
        5408,
        4339,
        24
      },
      {
        5590,
        4138,
        24
      },
      {
        12837,
        6701,
        16
      },
      {
        13126,
        6701,
        16
      }
    },
    tbStartPutNpcs = {
      {
        73,
        8489,
        12248,
        0
      }
    },
    tbFlogNpcPos = {
      {
        1724,
        3,
        8391,
        8515,
        48,
        "OCC_Longzhu_sun"
      }
    }
  }
}
DomainBattle.STATE_TRANS = {
  {
    nSeconds = 300,
    szFunc = "StartFight",
    szDesc = "准备阶段"
  },
  {
    nSeconds = 1500,
    szFunc = "StopFight",
    szDesc = "战斗阶段"
  },
  {
    nSeconds = 10,
    szFunc = "CloseBattle",
    szDesc = "结算阶段"
  }
}
DomainBattle.tbActiveCountFunc = {
  [900] = "SynGameTime",
  [1200] = "SynGameTime",
  [1380] = "SynGameTime",
  [1440] = "SynGameTime",
  [1470] = "SynGameTime",
  [1490] = "SynGameTime"
}
DomainBattle.tbMapLevelDesc = {
  "主城",
  "村镇",
  "野外"
}
DomainBattle.tbMapPosSetting = tbMapPosSetting
DomainBattle.tbMapSetting = tbMapSetting
local function fnSetMapLevel()
  local tbMapLevel = {}
  tbMapLevel[tbMapSetting.nMapTemplateId] = {1}
  for i1, v1 in ipairs(tbMapSetting.tbChilds) do
    tbMapLevel[v1.nMapTemplateId] = {2, i1}
    for i2, v2 in ipairs(v1.tbChilds) do
      tbMapLevel[v2.nMapTemplateId] = {
        3,
        i1,
        i2
      }
    end
  end
  DomainBattle.tbMapLevel = tbMapLevel
end
fnSetMapLevel()
function DomainBattle:GetMapSetting(nMapTemplateId)
  return self.tbMapPosSetting[nMapTemplateId]
end
function DomainBattle:GetMapLevel(nMapTemplateId)
  local tb = self.tbMapLevel[nMapTemplateId]
  if tb then
    return tb[1]
  end
end
function DomainBattle:GetLevelMaps(nLevel)
  if nLevel == 1 then
    return {
      self.tbMapSetting.nMapTemplateId
    }
  elseif nLevel == 2 then
    local tbMaps = {}
    for i, v in ipairs(self.tbMapSetting.tbChilds) do
      table.insert(tbMaps, v.nMapTemplateId)
    end
    return tbMaps
  elseif nLevel == 3 then
    local tbMaps = {}
    for i, v in ipairs(self.tbMapSetting.tbChilds) do
      for i2, v2 in ipairs(v.tbChilds) do
        table.insert(tbMaps, v2.nMapTemplateId)
      end
    end
    return tbMaps
  end
end
function DomainBattle:GetFatherLinkMap(nMapTemplateId)
  local tbMapLevel = self.tbMapLevel[nMapTemplateId]
  if not tbMapLevel then
    return
  end
  local nLevel, index1, index2 = unpack(tbMapLevel)
  if index2 then
    return self.tbMapSetting.tbChilds[index1].nMapTemplateId
  end
  if index1 then
    return self.tbMapSetting.nMapTemplateId
  end
end
function DomainBattle:GetChildLinkMap(nMapTemplateId)
  local tbMapLevel = self.tbMapLevel[nMapTemplateId]
  if not tbMapLevel then
    return
  end
  local nLevel, index1, index2 = unpack(tbMapLevel)
  if index2 then
    return
  end
  if index1 then
    local tbChilds = {}
    for i, v in ipairs(self.tbMapSetting.tbChilds[index1].tbChilds) do
      table.insert(tbChilds, v.nMapTemplateId)
    end
    return tbChilds
  end
  local tbChilds = {}
  for i, v in ipairs(self.tbMapSetting.tbChilds) do
    table.insert(tbChilds, v.nMapTemplateId)
  end
  return tbChilds
end
function DomainBattle:GetWinKin(tbFlagState, nMapTemplateId)
  local tbFlogNpcPos = self.tbMapPosSetting[nMapTemplateId].tbFlogNpcPos
  local tbFlagVal = {}
  local nMaxVal = 0
  local tbWinKin
  for nIndex, v in ipairs(tbFlagState) do
    local dwKinId = v[1]
    if dwKinId ~= -1 then
      tbFlagVal[dwKinId] = (tbFlagVal[dwKinId] or 0) + tbFlogNpcPos[nIndex][2]
      if nMaxVal < tbFlagVal[dwKinId] then
        nMaxVal = tbFlagVal[dwKinId]
        tbWinKin = v
      end
    end
  end
  return tbWinKin
end
function DomainBattle:CanKinSignUpMap(nMapTemplateId, nBattleVersion)
  if nBattleVersion == 0 then
    return false, "当前未开启宣战"
  end
  local nMapLevel = self:GetMapLevel(nMapTemplateId)
  if not nMapLevel then
    return false, "无效的宣战地图"
  end
  if nBattleVersion == 1 then
    if nMapLevel < 3 then
      return false, "当前领地暂未开放宣战"
    end
  elseif nBattleVersion == 2 and nMapLevel < 2 then
    return false, "当前领地暂未开放宣战"
  end
  return true
end
function DomainBattle:Honor2Box(dwRoleId, nGetHonor, tbAwardList)
  local nCurHonor = 0
  local nBoxCount = 0
  local nLeftHonor = 0
  if not tbAwardList then
    return nCurHonor, nBoxCount, nLeftHonor
  end
  local pAsync = KPlayer.GetAsyncData(dwRoleId)
  if not pAsync then
    return nCurHonor, nBoxCount, nLeftHonor
  end
  nCurHonor = pAsync.GetDomainHonor()
  nLeftHonor = nCurHonor + nGetHonor
  local tbTimeFrameAward
  for i, v in ipairs(self.define.tbExchangeBoxHonor) do
    if GetTimeFrameState(v[1]) ~= 1 then
      break
    end
    tbTimeFrameAward = v
  end
  if not tbTimeFrameAward then
    Log(debug.traceback())
    return
  end
  local nCanChangeNum = math.floor(nLeftHonor / tbTimeFrameAward[3])
  if nCanChangeNum > 0 then
    local nCostHonor = nCanChangeNum * tbTimeFrameAward[3]
    nLeftHonor = nLeftHonor - nCostHonor
    table.insert(tbAwardList, {
      "item",
      tbTimeFrameAward[2],
      nCanChangeNum
    })
    nBoxCount = nBoxCount + nCanChangeNum
  end
  return nCurHonor, nBoxCount, nLeftHonor
end
